package com.linshengjian.power.service;

import com.linshengjian.core.BusinessException;
import com.linshengjian.core.IBaseService;
import com.linshengjian.power.model.Permission;
import com.linshengjian.power.model.Role;

import java.util.List;

public interface IRoleService extends IBaseService<Role, Integer> {
    /**
     * 给角色添加一个权限
     * @param rid 角色ID
     * @param pid 权限ID
     */
    void addPermission(Integer rid, Integer pid) throws BusinessException;

    /**
     * 删除角色的权限
     * @param rid 角色ID
     * @param pid 权限ID
     */
    void delPermission(Integer rid, Integer pid) throws BusinessException;

    /**
     * 获取角色下的所有权限
     * @param id 角色ID
     * @return
     */
    List<Permission> permission(Integer id) throws BusinessException;
}
